#ifndef MAINWIDGET_H
#define MAINWIDGET_H

/*该类为主窗口类，GUI*/

#include <QWidget>
#include <QMouseEvent>
#include <QPushButton>
#include "UserLayer/External/pagemanger.h"
#include "AbstractLayer/Network/threadmanger.h"
namespace Ui {
class MainWidget;
}

class MainWidget : public QWidget
{
    Q_OBJECT
    friend class PageManger;
public:
    explicit MainWidget(QWidget *parent = nullptr);
    ~MainWidget();
    void setCurrentBtnOfPage(int index);

private slots:
    void on_btn_min_clicked();

    void on_btn_close_clicked();

    void on_btn_contact_clicked();

    void on_btn_chat_clicked();

    void on_btn_favorites_clicked();

    void on_btn_setting_clicked();
    void on_btn_avatar_clicked();


public slots:
    //减去消息数
    void subChatCount(int);
private:
    Ui::MainWidget *ui;
    QPushButton *nowchecked;

private:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void addContactCount();
    int nowmessagecount;
    int nowcontactcount;
    bool m_bDrag;
    QPoint mouseStartPoint;
    QPoint windowTopLeftPoint;
};

#endif // MAINWIDGET_H
